<?php

$mensaje = $id . '*'; //id
$mensaje.=$estado . '*'; //sonido
if($valido=='1'){
    $mensaje.='100*120*200*'; //color pantalla
}else{
    $mensaje.='255*21*16*'; //color pantalla
}

$mensaje.='2000*'; //frecuencia
$mensaje.="$nbusquedaGPS*"; //espera de gps en segundos
$mensaje.="$ndistanciaGPS*"; //metros de exactitud en metros
$mensaje.="$latitud1*";
$mensaje.="$longitud1*";
$mensaje.="$latitud2*";
$mensaje.="$longitud2#";
//$placa="Mk-2138";


$tipo=1;
$hora=date("g:i:s a",$horaControl);

$palabra = "Hora: $hora";
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "5";
$y = "5";
$mensaje.="$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$ultimoParadero;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "5";
$y = "25";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

//$tipo=1;
//$empresa="$celular";
//$palabra = $empresa;
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "45";
//$y = "35";
//$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=3;
$x1=4;
$y1=40;
$ancho=120;
$alto=20;
$estilo=0; //solid 0 , dotted 1
$cr = "0"; //color fondo
$cg = "0";
$cb = "0";
$cr1 = "255"; //color linea
$cg1 = "255";
$cb1 = "255";
$contorno=1;  //1 con contorno 0 sin contorno
$fondo=1;  //1 con fondo 0 sin fondo
$arcow=3;
$arcoh=3;
$mensaje.="#$tipo*$x1*$y1*$ancho*$alto*$estilo*$cr*$cg*$cb*$cr1*$cg1*$cb1*$contorno*$fondo*$arcow*$arcoh";


$tipo=3;
$x1=24;
$y1=40;
$ancho=50;
$alto=20;
$estilo=0; //solid 0 , dotted 1
$cr = "0"; //color fondo
$cg = "0";
$cb = "0";
$cr1 = "255"; //color linea
$cg1 = "255";
$cb1 = "255";
$contorno=1;  //1 con contorno 0 sin contorno
$fondo=1;  //1 con fondo 0 sin fondo
$arcow=0;
$arcoh=0;
$mensaje.="#$tipo*$x1*$y1*$ancho*$alto*$estilo*$cr*$cg*$cb*$cr1*$cg1*$cb1*$contorno*$fondo*$arcow*$arcoh";


$tipo=1;

$palabra = "N";
$cr = "255";
$cg = "255";
$cb = "255";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "9";
$y = "45";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;

$palabra = "T";
$cr = "255";
$cg = "255";
$cb = "255";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "45";
$y = "45";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$palabra = "Km";
$cr = "255";
$cg = "255";
$cb = "255";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "92";
$y = "45";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=3;
$x1=4;
$y1=60;
$ancho=120;
$alto=60;
$estilo=0; //solid 0 , dotted 1
$cr = "255"; //color fondo
$cg = "255";
$cb = "255";
$cr1 = "0"; //color linea
$cg1 = "0";
$cb1 = "0";
$contorno=1;  //1 con contorno 0 sin contorno
$fondo=1;  //1 con fondo 0 sin fondo
$arcow=0;
$arcoh=0;
$mensaje.="#$tipo*$x1*$y1*$ancho*$alto*$estilo*$cr*$cg*$cb*$cr1*$cg1*$cb1*$contorno*$fondo*$arcow*$arcoh";

$tipo=3;
$x1=4;
$y1=80;
$ancho=120;
$alto=20;
$estilo=0; //solid 0 , dotted 1
$cr = "255"; //color fondo
$cg = "255";
$cb = "255";
$cr1 = "0"; //color linea
$cg1 = "0";
$cb1 = "0";
$contorno=1;  //1 con contorno 0 sin contorno
$fondo=1;  //1 con fondo 0 sin fondo
$arcow=0;
$arcoh=0;
$mensaje.="#$tipo*$x1*$y1*$ancho*$alto*$estilo*$cr*$cg*$cb*$cr1*$cg1*$cb1*$contorno*$fondo*$arcow*$arcoh";

$tipo=3;
$x1=24;
$y1=60;
$ancho=50;
$alto=60;
$estilo=0; //solid 0 , dotted 1
$cr = "255"; //color fondo
$cg = "255";
$cb = "255";
$cr1 = "0"; //color linea
$cg1 = "0";
$cb1 = "0";
$contorno=1;  //1 con contorno 0 sin contorno
$fondo=0;  //1 con fondo 0 sin fondo
$arcow=0;
$arcoh=0;
$mensaje.="#$tipo*$x1*$y1*$ancho*$alto*$estilo*$cr*$cg*$cb*$cr1*$cg1*$cb1*$contorno*$fondo*$arcow*$arcoh";

$tipo=1;
$empresa='1';
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "9";
$y = "64";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";


$tipo=1;
$empresa='2';
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "9";
$y = "84";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa='3';
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "9";
$y = "104";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$tiempo1;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "35";
$y = "64";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$tiempo2;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "35";
$y = "84";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$tiempo3;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "35";
$y = "104";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$distancia1;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "90";
$y = "64";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$distancia2;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "90";
$y = "84";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

$tipo=1;
$empresa=$distancia3;
$palabra = $empresa;
$cr = "0";
$cg = "0";
$cb = "0";
$aspecto = "0";
$estilo = "0";
$tam = "0";
$aliv = "16";
$alih = "4";
$x = "90";
$y = "104";
$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//
//$palabra = "1";
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "4";
//$y = "80";
//$mensaje.="#$tipo*$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//$palabra = "Placa: $placa";
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "0";
//$y = "0";
//$mensaje.="$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";

//$nparadero=11;
//$palabra = "Control: $nparadero";
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "0";
//$y = "15";
//$mensaje.="#$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//
////$hmarcacion="22h:10:15";
//$palabra = "Hora: $hmarcacion";
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "0";
//$y = "30";
//$mensaje.="#$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//
//$palabra = "Recorrido: $distanciaMostrar";
//$cr = "0";
//$cg = "0";
//$cb = "0";
//$aspecto = "0";
//$estilo = "0";
//$tam = "0";
//$aliv = "16";
//$alih = "4";
//$x = "0";
//$y = "45";
//$mensaje.="#$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//
/////////////////////////////////
//
//$numero = count($arrayUnidades);
//$cont = 1;
//$yfor=65;
//for ($i = 0; $i < $numero; $i++) {
//    $placa = $arrayUnidades[$i]["vplaca"];
//    $palabra = "$cont:$placa";
//    $cr = "0";
//    $cg = "0";
//    $cb = "0";
//    $aspecto = "0";
//    $estilo = "0";
//    $tam = "0";
//    $aliv = "16";
//    $alih = "4";
//    $x = "0";
//    $y = $yfor;
//    $mensaje.="#$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//    $yfor=$yfor+15;
//    if($arrayUnidades[$i]['diferenciatiempos']>0){
//        $dtiempo1 = date("G:i:s",$arrayUnidades[$i]['diferenciatiempos']+18000);
//    }else{
//        $dtiempo1 = "-".date("G:i:s",-$arrayUnidades[$i]['diferenciatiempos']+18000);
//    }
//   
//   
//    
//    //$dtiempo1=$arrayUnidades[$i]['diferenciatiempos'];
//    
//    $ddistancia1 = substr ( $arrayUnidades[$i]['diferencia'] , 0 , 5 )." km";
//    $palabra = "H:$dtiempo1 D:$ddistancia1";
//    $cr = "0";
//    $cg = "0";
//    $cb = "0";
//    $aspecto = "0";
//    $estilo = "0";
//    $tam = "0";
//    $aliv = "16";
//    $alih = "4";
//    $x = "0";
//    $y = $yfor;
//    $mensaje.="#$palabra*$cr*$cg*$cb*$aspecto*$estilo*$tam*$aliv*$alih*$x*$y";
//    $yfor=$yfor+20;
//    $cont++;
//}

/////////////////////////////////




echo $mensaje;
?>
